package thesis.filesharing.bo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import thesis.filesharing.bo.ExerciseFileBO;
import thesis.filesharing.dao.ExerciseFileDAO;
import thesis.filesharing.model.ExerciseFile;

import com.google.appengine.api.datastore.Key;

@Service
public class ExerciseFileBOImpl implements ExerciseFileBO {
	
	@Autowired
	private ExerciseFileDAO exerciseFileDAO;
	
	@Override
	public List<ExerciseFile> saveExerciseFileCollection(List<ExerciseFile> exerciseFiles, Key studentKey, Key classKey, Key exerciseKey) {
		return exerciseFileDAO.saveExerciseFileCollection(exerciseFiles, studentKey, classKey, exerciseKey);
	}

	@Override
	public List<ExerciseFile> listExerciseFilesStudentOrGroupUploadedPerExercise(Key exerciseKey, Key studentKey, Key classKey) {
		return exerciseFileDAO.listExerciseFilesStudentOrGroupUploadedPerExercise(exerciseKey, studentKey, classKey);
	}

	@Override
	public void deleteExerciseFiles(List<Key> exerciseFileKeys, Key exerciseKey) {
		exerciseFileDAO.deleteExerciseFiles(exerciseFileKeys, exerciseKey);
	}
}
